package com.qyhl.webtv.module_live.teletext.detail;


import com.qyhl.webtv.commonlib.entity.intergral.CoinBean;
import com.qyhl.webtv.commonlib.entity.live.ShoppingListBean;
import com.qyhl.webtv.commonlib.entity.live.TeleTextBean;

/**
 * Created by qyhl on 2017/12/15.
 */

public class TeleTextPresenter implements TeleTextContract.TeleTextPresenter {
    private TeleTextModel mModel;

    private TeleTextContract.TeleTextView mView;

    public TeleTextPresenter(TeleTextContract.TeleTextView mView) {
        this.mView = mView;
        this.mModel = new TeleTextModel(this);
    }

    @Override
    public void getDetail(String sceneId) {
        mModel.getDetail(sceneId);
    }

    @Override
    public void getPraise(String sceneId) {
        mModel.getPraise(sceneId);
    }

    @Override
    public void addClick(String sceneId) {
        mModel.addClick(sceneId);
    }

    @Override
    public void setDetail(TeleTextBean bean) {
        mView.setDetail(bean);
    }

    @Override
    public void setError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.setError(msg);
                break;
            case 2:
                mView.setEmpty(msg);
                break;
            default:
                break;
        }
    }

    @Override
    public void praiseSuccess(String msg) {
        mView.praiseSuccess(msg);
    }

    @Override
    public void praiseError(String msg) {
        mView.praiseError(msg);
    }

    @Override
    public void dofollow(String sceneId) {
        mModel.dofollow(sceneId);
    }

    @Override
    public void unfollow(String sceneId) {
        mModel.unfollow(sceneId);
    }

    @Override
    public void followSuccess(String msg, String sceneId) {
        mView.followSuccess(msg, sceneId);
    }

    @Override
    public void followError(String msg) {
        mView.followError(msg);
    }

    @Override
    public void unfollowSuccess(String msg, String sceneId) {
        mView.unfollowSuccess(msg, sceneId);
    }

    @Override
    public void unfollowError(String msg) {
        mView.unfollowError(msg);
    }

    @Override
    public void getCoin(String username) {
        mModel.getCoin(username);
    }

    @Override
    public void getCoinSuccess(CoinBean bean) {
        mView.getCoinSuccess(bean);
    }

    @Override
    public void getCoinFailure(String msg) {
        mView.getCoinFailure(msg);
    }

    @Override
    public void getShopTop(String sceneId) {
        mModel.getShopTop(sceneId);
    }

    @Override
    public void setShopTop(ShoppingListBean bean) {
        mView.setShopTop(bean);
    }
}
